﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JLL.China.Infrastructure.Services;
using JLL.China.Model;
using JLL.China.Model.DTO;
using JLL.China.Web.Libraries;
namespace JLL.China.Web.Areas.Portal.Models
{
    public class PortalModel
    {
        public int CategoryID { get; set; }
        public News NewsModel { get; set; }
        public News NewsModel_Local { get; set; }

        public IList<Model.News> GetNewsByCategory()
        {
            return NewsService.GetByCategory(this.CategoryID);
        }
        public Model.News NewsItem(int id)
        {
            return NewsService.FindNews(id);
        }
        public IList<Model.News> GetNews()
        {
            this.CategoryID = 1; //News
            
            return this.GetNewsByCategory();
        }
        public IList<Model.News> GetReseach()
        {
            this.CategoryID = 2; //Research
            return this.GetNewsByCategory();
        }
        public IList<Model.News> GetService()
        {
            this.CategoryID = 3; //Service
            return this.GetNewsByCategory();
        }
    }
}
